package com.nut.spp.api.req;

import com.nut.spp.enums.SmsEnum;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 短信验证码参数
 */
@Data
@NoArgsConstructor
public class SendSmsCodeReq {

    @NotBlank
    private String mobile;

    @NotNull
    private Integer type;

    /**
     * 获取短信类型
     * @return
     */
    public SmsEnum getSmsEnum() {
        return SmsEnum.getByType(type);
    }

}
